﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AmiEmuLib.Configuration;
using System.Reflection;
using System.Xml;
using System.Diagnostics;
using AmiEmuLib.AmigaConfiguration;

namespace AmiEmuLib.AmigaMachine.AmigaMemory
{
    /// <summary>
    /// Represent 64KB rom memory bank.
    /// </summary>
    public class ReadOnlyMemoryBank : RamMemoryBank
    {
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="a_address"></param>
        /// <param name="a_memory"></param>
        /// <param name="a_type"></param>
        /// <param name="a_fast"></param>
        public ReadOnlyMemoryBank(uint a_address, Memory a_memory, MemoryBankType a_type, bool a_fast, 
            byte[] a_rom, uint a_index) 
                : base(a_address, a_memory, a_type, a_fast)
        {
            for (int i = 0; i < Consts.BANK_SIZE / 2; i++)
                m_values[i] = Consts.RESET_WORD_VALUE;

            for (uint i = 0; i < m_values.Length; i++)
            {
                // Some roms don't sit tighly in banks.
                if (a_index >= a_rom.Length)
                    break;

                m_values[i] = MemoryHelpers.MakeWord(a_rom[a_index++], a_rom[a_index++]);
            }
        }

        internal override void Reset()
        {
        }

        public override void SetByte(uint a_address, byte a_value)
        {
        }

        public override void SetWord(uint a_address, ushort a_value)
        {
        }

        public override void SetLong(uint a_address, uint a_value)
        {
        }
    }
}
